<?php
/**
 * @package    JWPBlog
 * @author David Neimeyer davidneimeyer@gmail.com
 * @link http://indie-bookstore.googlecode.com/
 * @license    GNU/GPL
 * 
 */

/** access via Joomla! index only */
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');

/**
 * HTML View for the JWPBlog component
 * 
 * this is a basic console (grid) for access
 *  to the sub components
 */

class JwpblogViewJwpblog extends JwpblogViewBase
{
	
	function submenu($user){
		JSubMenuHelper::addEntry( JText::_( 'Dashboard' ), 'index.php?option=com_jwpblog', true);
		JSubMenuHelper::addEntry( JText::_( 'Write' ), 'index.php?option=com_jwpblog&controller=post');
		JSubMenuHelper::addEntry( JText::_( 'Manage' ), 'index.php?option=com_jwpblog&controller=edit&view=events');
		JSubMenuHelper::addEntry( JText::_( 'Design' ), 'index.php?option=com_jwpblog&controller=theme&view=venues');
		JSubMenuHelper::addEntry( JText::_( 'Comments' ), 'index.php?option=&controller=comments&view=categories');
		JSubMenuHelper::addEntry( JText::_( 'HELP' ), 'index.php?option=com_jwpblog&view=help');
		if ($user->get('gid') > 24) {
			JSubMenuHelper::addEntry( JText::_( 'SETTINGS' ), 'index.php?option=com_jwpblog&controller=settings&task=edit');
			JSubMenuHelper::addEntry( JText::_( 'PLUGINS' ), 'index.php?option=com_jwpblogt&controller=plugins');
			JSubMenuHelper::addEntry( JText::_( 'USERS' ), 'index.php?option=com_jwpblog&controller=users');
		}		
	}	
	
	function display($tpl = NULL){
		jimport('joomla.html.pane');

		//initialise variables
		$document	= & JFactory::getDocument();
		$pane   	= & JPane::getInstance('sliders');
		$user 		= & JFactory::getUser();

		//build toolbar
		JToolBarHelper::title( 'JWPBlog - '.JText::_( 'Dashboard' ), 'Home' );
		JToolBarHelper::help( 'el.intro', true );

		// Get data from the model
		
		//add css and submenu to document
		//$document->addStyleSheet('');

		//Create Submenu
		$this->submenu($user);
		
		//assign vars to the template
		$this->assignRef('pane'			, $pane);		
		$this->assignRef('user'			, $user);

		parent::display($tpl);
	}
}
?>